#include "stdafx.h"
#include "Hand.h"
#include "HandInfo.h"
#include "Player.h"
#include "VpipHandInfoBuilder.h"
#include <algorithm>

// voluntarily put money into the pot preflop

void VpipHandInfoBuilder::Fill(HandInfo &handInfo, const Hand &hand)
{
	list<Action> actions = hand.Actions();
	list<Action>::const_iterator actionIt;	
	
	for (actionIt = actions.begin(); actionIt != actions.end(); actionIt++)
	{
		if (actionIt->StreetPos() != PREFLOP)
			return;

		ActionType actionType = actionIt->ActionType();
		string playerName = actionIt->PlayerName();

		if (actionType == RAISE || actionType == CALL)
		{
			handInfo.PlayerInfo(playerName).Vpip(true);
		}
	}
}